/* 
商品管理的平台属性相关的接口请求函数
*/
import request from '@/utils/request';

//一级
export default {
  reqCategory1List() {
    return request.get(`/admin/product/getCategory1`)
  },
  //2
  reqCategory2List(category1Id) {
    return request.get(`/admin/product/getCategory2/${category1Id}`)
  },
  //3
  reqCategory3List(category2Id) {
    return request.get(`/admin/product/getCategory3/${category2Id}`)
  },
  //获取平台属性
  reqAttrList(category1Id, category2Id, category3Id) {
    return request.get(`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`)
  },

  //添加属性与属性值接口  /admin/product/saveAttrInfo  post  带参数
  addOrUpdateAttr(data) {
    return request.post(`/admin/product/saveAttrInfo`)
  }
}






/*

export default {
   
  根据3级分类获取属性列表
  GET /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
  
  getList (category1Id, category2Id, category3Id) {
    return request(`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`)
  },

  
  根据ID删除对应的属性
  DELETE /admin/product/deleteAttr/{attrId}
  
  remove (id) {
    return request.delete(`/admin/product/deleteAttr/${id}`)
  },

  /* 
  根据属性id获取属性值列表
  GET /admin/product/getAttrValueList/{attrId}
  *
  getValueList (attrId) {
    return request(`/admin/product/getAttrValueList/${attrId}`)
  },

  /* 
  添加/更新属性
  POST /admin/product/saveAttrInfo
  attrInfo如果有id那就是更新, 如果没有id那就是添加
  *
  addOrUpdate (attrInfo) {
    return request.post('/admin/product/saveAttrInfo', attrInfo)
  } 
}

*/